<?php

/**
 * Zonebosslist filter form base class.
 *
 * @package    raidpoints
 * @subpackage filter
 * @author     David Driscoll
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseZonebosslistFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'zoneid'     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Zone'), 'add_empty' => true)),
      'sort'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'name'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'shortname1' => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'shortname2' => new sfWidgetFormFilterInput(),
      'shortname3' => new sfWidgetFormFilterInput(),
      'header'     => new sfWidgetFormFilterInput(),
      'headersort' => new sfWidgetFormFilterInput(),
      'shown'      => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'killdate'   => new sfWidgetFormFilterInput(),
      'screenshot' => new sfWidgetFormFilterInput(),
      'topic'      => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'zoneid'     => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Zone'), 'column' => 'id')),
      'sort'       => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'name'       => new sfValidatorPass(array('required' => false)),
      'shortname1' => new sfValidatorPass(array('required' => false)),
      'shortname2' => new sfValidatorPass(array('required' => false)),
      'shortname3' => new sfValidatorPass(array('required' => false)),
      'header'     => new sfValidatorPass(array('required' => false)),
      'headersort' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'shown'      => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'killdate'   => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'screenshot' => new sfValidatorPass(array('required' => false)),
      'topic'      => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('zonebosslist_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Zonebosslist';
  }

  public function getFields()
  {
    return array(
      'id'         => 'Number',
      'zoneid'     => 'ForeignKey',
      'sort'       => 'Number',
      'name'       => 'Text',
      'shortname1' => 'Text',
      'shortname2' => 'Text',
      'shortname3' => 'Text',
      'header'     => 'Text',
      'headersort' => 'Number',
      'shown'      => 'Boolean',
      'killdate'   => 'Number',
      'screenshot' => 'Text',
      'topic'      => 'Text',
    );
  }
}
